\(\int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx\) [87]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F(-1)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 67 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 \sqrt {a+i a \tan (c+d x)}}{d} \]

[Out]

-arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))*2^(1/2)*a^(1/2)/d+2*(a+I*a*tan(d*x+c))^(1/2)/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3608, 3561, 212} \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {2 \sqrt {a+i a \tan (c+d x)}}{d}-\frac {\sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d} \]

[In]

Int[Tan[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

-((Sqrt[2]*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d) + (2*Sqrt[a + I*a*Tan[c + d*x]])/
d

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3561

Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(2*a - x^2), x], x, Sq
rt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0]

Rule 3608

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*(
(a + b*Tan[e + f*x])^m/(f*m)), x] + Dist[(b*c + a*d)/b, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c,
d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] &&  !LtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {2 \sqrt {a+i a \tan (c+d x)}}{d}-i \int \sqrt {a+i a \tan (c+d x)} \, dx \\ & = \frac {2 \sqrt {a+i a \tan (c+d x)}}{d}-\frac {(2 a) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = -\frac {\sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 \sqrt {a+i a \tan (c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.00 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 \sqrt {a+i a \tan (c+d x)}}{d} \]

[In]

Integrate[Tan[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

-((Sqrt[2]*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d) + (2*Sqrt[a + I*a*Tan[c + d*x]])/
d

Maple [A] (verified)

Time = 1.08 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.79

method result size
derivativedivides \(\frac {2 \sqrt {a +i a \tan \left (d x +c \right )}-\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{d}\) \(53\)
default \(\frac {2 \sqrt {a +i a \tan \left (d x +c \right )}-\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{d}\) \(53\)

[In]

int((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(2*(a+I*a*tan(d*x+c))^(1/2)-a^(1/2)*2^(1/2)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2)))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 187 vs. \(2 (52) = 104\).

Time = 0.24 (sec) , antiderivative size = 187, normalized size of antiderivative = 2.79 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {2} d \sqrt {\frac {a}{d^{2}}} \log \left (4 \, {\left ({\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {a}{d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \sqrt {2} d \sqrt {\frac {a}{d^{2}}} \log \left (-4 \, {\left ({\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {a}{d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - 4 \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} e^{\left (i \, d x + i \, c\right )}}{2 \, d} \]

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="fricas")

[Out]

-1/2*(sqrt(2)*d*sqrt(a/d^2)*log(4*((d*e^(2*I*d*x + 2*I*c) + d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(a/d^2) +
 a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - sqrt(2)*d*sqrt(a/d^2)*log(-4*((d*e^(2*I*d*x + 2*I*c) + d)*sqrt(a/(e^(2
*I*d*x + 2*I*c) + 1))*sqrt(a/d^2) - a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - 4*sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*
c) + 1))*e^(I*d*x + I*c))/d

Sympy [F]

\[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \tan {\left (c + d x \right )}\, dx \]

[In]

integrate((a+I*a*tan(d*x+c))**(1/2)*tan(d*x+c),x)

[Out]

Integral(sqrt(I*a*(tan(c + d*x) - I))*tan(c + d*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.24 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {\sqrt {2} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + 4 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{2}}{2 \, a^{2} d} \]

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="maxima")

[Out]

1/2*(sqrt(2)*a^(5/2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*x +
 c) + a))) + 4*sqrt(I*a*tan(d*x + c) + a)*a^2)/(a^2*d)

Giac [F(-1)]

Timed out. \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\text {Timed out} \]

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="giac")

[Out]

Timed out

Mupad [B] (verification not implemented)

Time = 4.37 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.81 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {2\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}-\frac {\sqrt {2}\,\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{d} \]

[In]

int(tan(c + d*x)*(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

(2*(a + a*tan(c + d*x)*1i)^(1/2))/d - (2^(1/2)*a^(1/2)*atanh((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2))/(2*a^(1/2
))))/d